<script type="text/javascript" src="{$base_dir}js/swfobject.js"></script>
<script type="text/javascript" src="{$base_dir}js/json2.js"></script>
<script type="text/javascript">
var base_uri = {$base_dir} + "flash/open-flash-chart.swf";
var exportImage = ":)";
var messLoading = "{translate}Drawing chart{/translate}...";
{literal}
var params = {wmode: "opaque"};
swfobject.embedSWF(base_uri, "portletPatientNumber", "830", "200", "9.0.0", "expressInstall.swf", {"data-file":"patientNumberData?set_ajax_view", "loading":messLoading}, params);
var params = {wmode: "opaque"};
swfobject.embedSWF(base_uri, "portletPatientAge", "530", "200", "9.0.0", "expressInstall.swf", {"data-file":"patientAgeData?set_ajax_view", "loading":messLoading}, params);
var params = {wmode: "opaque"};
swfobject.embedSWF(base_uri, "portletRevenue", "830", "250", "9.0.0", "expressInstall.swf", {"data-file":"revenueData?set_ajax_view", "loading":messLoading}, params);

OFC = {};
 
OFC.jquery = {
    name: "jQuery",
    version: function(src) { return $('#'+ src)[0].get_version() },
    rasterize: function (src, dst) { $('#'+ dst).replaceWith(OFC.jquery.image(src)) },
    image: function(src) { return "<img src='data:image/png;base64," + $('#'+src)[0].get_img_binary() + "' />"},
    popup: function(src) {
    	{/literal}
        var title = '{translate}Charts: Export as Image{/translate}';
        {literal}
        var img_win = window.open('', title)
        with(img_win.document) {
        	{/literal}
            var titlehead = '{translate}Charts: Export as Image{/translate}';
            {literal}
            write('<html><head><title>' + titlehead + '<\/title><\/head><body>' + OFC.jquery.image(src) + '<\/body><\/html>') }
     }
}

if (typeof(Control == "undefined")) {var Control = {OFC: OFC.jquery}}

function save_image() { OFC.jquery.popup(exportImage) }

function set_export_flash(flashId) {
	exportImage = flashId;
}

$(document).ready(function(){
	activeMenu('2', '75');
});
{/literal}
</script>

<div onmouseover="set_export_flash('portletPatientNumber');">
	<div id="portletPatientNumber"></div>
</div>
<div onmouseover="set_export_flash('portletRevenue');" style='margin-top: 20px;'>
	<div id="portletRevenue"></div>
</div>
<table cellspacing='0' cellpadding='0' style='border: none;'>
	<tr>		
		<td>
			<div onmouseover="set_export_flash('portletPatientAge');" style='float: right; margin-top: 20px;'>
				<div id="portletPatientAge"></div>
			</div>
		</td>
	</tr>
</table>